package com.cong.日期类;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class DateDemo04 {
    public static void main(String[] args) {
        //日历类
        Calendar instance = Calendar.getInstance();
        /*
        java.util.GregorianCalendar[time=1644283374824,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="Asia/Shanghai",offset=28800000,dstSavings=0,useDaylight=false,transitions=29,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2022,MONTH=1,WEEK_OF_YEAR=7,WEEK_OF_MONTH=2,DAY_OF_MONTH=8,DAY_OF_YEAR=39,DAY_OF_WEEK=3,DAY_OF_WEEK_IN_MONTH=2,AM_PM=0,HOUR=9,HOUR_OF_DAY=9,MINUTE=22,SECOND=54,MILLISECOND=824,ZONE_OFFSET=28800000,DST_OFFSET=0]
         */
//        System.out.println(instance);

        int year = instance.get(Calendar.YEAR);
        int mon = instance.get(Calendar.MONTH)+1;//月默认是从0开始计时的
        int date = instance.get(Calendar.DATE);
        System.out.println(year+"年"+mon+"月"+date+"日");

    }
}
